🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

postcss-ordered-values

Package Overview
Dependencies
Maintainers
7
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-ordered-values

Ensure values are ordered consistently in your CSS.

7.0.2
latest
Source
npm
Version published
Weekly downloads
10M
-6.51%
Maintainers
7
Weekly downloads
 
Created

What is postcss-ordered-values?

The postcss-ordered-values npm package is a PostCSS plugin designed to optimize CSS by consistently ordering values within declarations. This can help in minimizing CSS size and improving readability and maintainability by ensuring a standardized order of values.

What are postcss-ordered-values's main functionalities?

Optimization of margin and padding values

This feature optimizes shorthand for margin and padding by collapsing redundant values. For example, if all four values of margin are the same, it simplifies it to a single value.

const postcss = require('postcss');
const orderedValues = require('postcss-ordered-values');

postcss([orderedValues()])
.process('a { margin: 1px 1px 1px 1px; }', { from: undefined })
.then(result => {
  console.log(result.css);
  // Output: 'a { margin: 1px; }'
});

Ordering of border values

This feature ensures the properties of borders are ordered consistently, typically width, style, and then color. This helps in maintaining a standard across your CSS files.

const postcss = require('postcss');
const orderedValues = require('postcss-ordered-values');

postcss([orderedValues()])
.process('a { border: solid 1px red; }', { from: undefined })
.then(result => {
  console.log(result.css);
  // Output: 'a { border: 1px solid red; }'
});

Other packages similar to postcss-ordered-values

Keywords

css

FAQs

Package last updated on 06 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts